{% extends 'learning_logs/base.html' %}

{% block header %}
    <h1>{{ topic }}</h1>
{% endblock header %}

{% block content %}

    <p>
        <a href="{% url 'learning_logs:new_entry' topic.id %}">add new entry</a>
    </p>

    {% for entry in entries %}
        <div class="panel panel-default">
        <div class="panel-heading">
            <h3>
                {{ entry.date_added | date:'Y-m-d H:i' }}

                    <a href="{% url 'learning_logs:edit_entry' entry.id %}" class="btn btn-default btn-xs">edit entry</a>

            </h3>
        </div>
        <div class="panel-body">
        {{ entry.text | linebreaks}}
        </div>
        </div>  <!-- panel -->
    {% empty %}
        当前主题没有任何的条目
    {% endfor %}

{% endblock content %}